<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt"%>
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<!-- 视窗 -->
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title></title>
<link href="/resource/bootstrap.min.css" rel="stylesheet">
<script type="text/javascript" src="/resource/jquery-3.2.1.js"></script>
<script type="text/javascript">
function goPage(pageNum){
	location="/list?pageNum="+pageNum;
}
function dele(id){
	$.post(
	"/dele",
	{id:id},
	function(flag){
		if(flag){
			alert("删除成功");
			location="/list";
		}else{
			alert("删除失败")
		}
	},"json"
	
	)
}
</script>
</head> 

<body>
<a href="/toAdd">增加</a>
<c:forEach items="${info.list }" var="g">
<div style="float: left;margin-left: 40px; margin-top: 20px">
<h5 style="color: skyblue">${g.ename }</h5>
<a href="/toUpda?id=${g.id }"><img style="width: 200px; height: 180px" alt="失效" src="/pic/${g.picture}"></a>
<h6>名字:${g.name }</h6>
<p>价钱<font color="red">￥${g.price }</font></p>
<p>特点:${g.tag }</p>
<p>大小:${g.size }库存:${g.size }</p>
<p>品牌:${g.br.name}类型:${g.ty.name}</p>

<a href="/upda?id=${g.id}">编辑</a>
<input type="button" value="删除" onclick="dele(${g.id})" style="color: black; background-color: red">
</div>
</c:forEach>
<div style="clear: both" align="center">
<jsp:include page="/WEB-INF/view/pages.jsp"></jsp:include>
</div>
</body>
</html>